package operation;

import book.Book;
import book.BookList;
import operation.Ioperation;

import java.util.Scanner;

public class AddBook implements Ioperation {
    public void work(BookList bookList){
        System.out.println("请输入书名：");
        Scanner ip=new Scanner(System.in);
        String name=ip.nextLine();
        System.out.println("请输入作者：");
        String author=ip.nextLine();
        System.out.println("请输入类型：");
        String type=ip.nextLine();
        System.out.println("请输入价格：");
        int price=ip.nextInt();

        Book book=new Book(name,author,price,type);
        bookList.setBooks(bookList.getNumber(),book);
        System.out.println("新增成功！！");
        bookList.setNumber(1);
    }
}
